package cn.csc.module.product.controller.app.spuattr;

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.module.product.controller.app.spuattr.vo.AppSpuAttrValueGetBySpuIdRespVO;
import cn.csc.module.product.service.spuattr.SpuAttrValueService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.List;

/**
 * @author liuchuang
 * @version 1.0
 * @date 2024/10/15 11:36
 * @modify
 */
@Api(tags = "管理后台 - 商品规格属性关联信息")
@RestController
@RequestMapping("/product/spu-attr-value")
@Validated
public class AppSpuAttrValueController {

    @Resource
    private SpuAttrValueService spuAttrValueService;

    @GetMapping
    @Operation(summary = "获取spu的基本属性信息" , description = "根据spuId获取基本属性信息")
    public CommonResult<List<AppSpuAttrValueGetBySpuIdRespVO>> getBySpuId(@RequestParam BigInteger spuId) {
        return CommonResult.success(spuAttrValueService.getBySpuId(spuId));
    }


}
